﻿using System;

namespace Aeon.Framework
{

/// <summary>
/// Static helper class for color creation and reference.
/// Contains a collection of color properties, usable directly or through a text string.
/// 
/// </summary>
public static class AeonColors 
    {
    // --- Attributes:
 
    public static AeonColor Black   = new AeonColor(0.0f,0.0f,0.0f);
    public static AeonColor White   = new AeonColor(1.0f,1.0f,1.0f);

    public static AeonColor Red     = new AeonColor(1.0f,0.0f,0.0f);
    public static AeonColor Green   = new AeonColor(0.0f,1.0f,0.0f);
    public static AeonColor Blue    = new AeonColor(0.0f,0.0f,1.0f);
    
    public static AeonColor Yellow  = new AeonColor(1.0f,1.0f,0.0f);
    public static AeonColor Pink    = new AeonColor(1.0f,0.0f,1.0f);
    public static AeonColor Cyan    = new AeonColor(0.0f,1.0f,1.0f);
        
    public static AeonColor Gray    = new AeonColor(0.5f,0.5f,0.5f);
    public static AeonColor Teal    = new AeonColor(0.3f,0.7f,1.0f);
    public static AeonColor Brown   = new AeonColor(0.5f,0.3f,0.2f);
    public static AeonColor Purple  = new AeonColor(0.4f,0.3f,0.6f);
    public static AeonColor Orange  = new AeonColor(1.0f,0.4f,0.2f);
    public static AeonColor Magenta = new AeonColor(0.3f,0.0f,0.0f);
    
    public static AeonColor RedDark    = new AeonColor(0.6f,0.0f,0.0f);
    public static AeonColor RedLight   = new AeonColor(1.0f,0.3f,0.3f);
    public static AeonColor BlueDark   = new AeonColor(0.0f,0.0f,0.7f);
    public static AeonColor BlueLight  = new AeonColor(0.4f,0.4f,1.0f);
    public static AeonColor BrownDark  = new AeonColor(0.2f,0.1f,0.1f);
    public static AeonColor BrownLight = new AeonColor(0.5f,0.4f,0.3f);

    public static AeonColor Default = AeonColors.White;
    
    // --- Public Methods:

    public static AeonColor FromText(String name)
        {
        name = name.ToLower();
        AeonColor color;

        switch(name)
            {
            default:         color = AeonColors.Default;  break;

            case("red"):     color = AeonColors.Red;      break;
            case("green"):   color = AeonColors.Green;    break;
            case("blue"):    color = AeonColors.Blue;     break;            
            case("yellow"):  color = AeonColors.Yellow;   break;
            case("pink"):    color = AeonColors.Pink;     break;
            case("cyan"):    color = AeonColors.Cyan;     break;            
            case("black"):   color = AeonColors.Black;    break;
            case("white"):   color = AeonColors.White;    break;
            case("brown"):   color = AeonColors.Brown;    break;
            case("teal"):    color = AeonColors.Teal;     break;
            case("gray"):    color = AeonColors.Gray;     break;
            case("grey"):    color = AeonColors.Gray;     break;            
            case("purple"):  color = AeonColors.Purple;   break;
            case("orange"):  color = AeonColors.Orange;   break;
            case("magenta"): color = AeonColors.Magenta;  break;

            case("dark red"): color = AeonColors.RedDark;       break;
            case("light red"): color = AeonColors.RedLight;     break;
            case("dark blue"): color = AeonColors.BlueDark;     break;
            case("light blue"): color = AeonColors.BlueLight;   break;
            case("dark brown"): color = AeonColors.BrownDark;   break;
            case("light brown"): color = AeonColors.BrownLight; break;
            }

        return(color);
        }
        
    }
    
    
}
    